

<!DOCTYPE html>
<!--[if IE 8]><html class="no-js lt-ie9" lang="zh" > <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js" lang="zh" > <!--<![endif]-->
<head>
  <meta charset="utf-8">
  
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  
  <title>Study &mdash; Optuna 1.4.0 文档</title>
  

  
  
    <link rel="shortcut icon" href="../../_static/favicon.ico"/>
  
  
  

  
  <script type="text/javascript" src="../../_static/js/modernizr.min.js"></script>
  
    
      <script type="text/javascript" id="documentation_options" data-url_root="../../" src="../../_static/documentation_options.js"></script>
        <script src="../../_static/jquery.js"></script>
        <script src="../../_static/underscore.js"></script>
        <script src="../../_static/doctools.js"></script>
        <script src="../../_static/language_data.js"></script>
        <script async="async" src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/latest.js?config=TeX-AMS-MML_HTMLorMML"></script>
    
    <script type="text/javascript" src="../../_static/js/theme.js"></script>

    

  
  <link rel="stylesheet" href="../../_static/css/theme.css" type="text/css" />
  <link rel="stylesheet" href="../../_static/pygments.css" type="text/css" />
  <link rel="stylesheet" href="../../_static/css/custom.css" type="text/css" />
    <link rel="index" title="索引" href="../../genindex.html" />
    <link rel="search" title="搜索" href="../../search.html" />
    <link rel="next" title="Trial" href="trial.html" />
    <link rel="prev" title="Samplers" href="samplers.html" /> 
</head>

<body class="wy-body-for-nav">

   
  <div class="wy-grid-for-nav">
    
    <nav data-toggle="wy-nav-shift" class="wy-nav-side">
      <div class="wy-side-scroll">
        <div class="wy-side-nav-search" >
          

          
            <a href="../../index.html" class="icon icon-home"> Optuna
          

          
          </a>

          
            
            
              <div class="version">
                1.4.0
              </div>
            
          

          
<div role="search">
  <form id="rtd-search-form" class="wy-form" action="../../search.html" method="get">
    <input type="text" name="q" placeholder="Search docs" />
    <input type="hidden" name="check_keywords" value="yes" />
    <input type="hidden" name="area" value="default" />
  </form>
</div>

          
        </div>

        <div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation">
          
            
            
              
            
            
              <p class="caption"><span class="caption-text">目录</span></p>
<ul class="current">
<li class="toctree-l1"><a class="reference internal" href="../../installation.html">安装</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../tutorial/index.html">教程</a></li>
<li class="toctree-l1 current"><a class="reference internal" href="../index.html">API Reference</a><ul class="current">
<li class="toctree-l2"><a class="reference internal" href="../core.html">Core</a></li>
<li class="toctree-l2"><a class="reference internal" href="../cli.html">Command Line Interface</a></li>
<li class="toctree-l2"><a class="reference internal" href="../distributions.html">Distributions</a></li>
<li class="toctree-l2"><a class="reference internal" href="../exceptions.html">Exceptions</a></li>
<li class="toctree-l2"><a class="reference internal" href="../importance.html">Hyperparameter Importance</a></li>
<li class="toctree-l2"><a class="reference internal" href="../integration.html">Integration</a></li>
<li class="toctree-l2"><a class="reference internal" href="../logging.html">Logging</a></li>
<li class="toctree-l2 current"><a class="reference internal" href="index.html">Multi-objective</a><ul class="current">
<li class="toctree-l3"><a class="reference internal" href="samplers.html">Samplers</a></li>
<li class="toctree-l3 current"><a class="current reference internal" href="#">Study</a></li>
<li class="toctree-l3"><a class="reference internal" href="trial.html">Trial</a></li>
<li class="toctree-l3"><a class="reference internal" href="visualization.html">Visualization</a></li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="../pruners.html">Pruners</a></li>
<li class="toctree-l2"><a class="reference internal" href="../samplers.html">Samplers</a></li>
<li class="toctree-l2"><a class="reference internal" href="../storages.html">Storages</a></li>
<li class="toctree-l2"><a class="reference internal" href="../structs.html">Structs</a></li>
<li class="toctree-l2"><a class="reference internal" href="../study.html">Study</a></li>
<li class="toctree-l2"><a class="reference internal" href="../trial.html">Trial</a></li>
<li class="toctree-l2"><a class="reference internal" href="../visualization.html">Visualization</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="../../faq.html">常见问题</a></li>
</ul>

            
          
        </div>
      </div>
    </nav>

    <section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">

      
      <nav class="wy-nav-top" aria-label="top navigation">
        
          <i data-toggle="wy-nav-top" class="fa fa-bars"></i>
          <a href="../../index.html">Optuna</a>
        
      </nav>


      <div class="wy-nav-content">
        
        <div class="rst-content">
        
          















<div role="navigation" aria-label="breadcrumbs navigation">

  <ul class="wy-breadcrumbs">
    
      <li><a href="../../index.html">Docs</a> &raquo;</li>
        
          <li><a href="../index.html">API Reference</a> &raquo;</li>
        
          <li><a href="index.html">Multi-objective</a> &raquo;</li>
        
      <li>Study</li>
    
    
      <li class="wy-breadcrumbs-aside">
        
            
            <a href="../../_sources/reference/multi_objective/study.rst.txt" rel="nofollow"> View page source</a>
          
        
      </li>
    
  </ul>

  
  <hr/>
</div>
          <div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
           <div itemprop="articleBody">
            
  <span class="target" id="module-optuna.multi_objective.study"></span><div class="section" id="study">
<h1>Study<a class="headerlink" href="#study" title="永久链接至标题">¶</a></h1>
<dl class="py class">
<dt id="optuna.multi_objective.study.MultiObjectiveStudy">
<em class="property">class </em><code class="sig-prename descclassname">optuna.multi_objective.study.</code><code class="sig-name descname">MultiObjectiveStudy</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">study</span><span class="p">:</span> <span class="n"><a class="reference internal" href="../study.html#optuna.study.Study" title="optuna.study.Study">optuna.study.Study</a></span></em><span class="sig-paren">)</span><a class="reference internal" href="../../_modules/optuna/multi_objective/study.html#MultiObjectiveStudy"><span class="viewcode-link">[源代码]</span></a><a class="headerlink" href="#optuna.multi_objective.study.MultiObjectiveStudy" title="永久链接至目标">¶</a></dt>
<dd><p>多目标优化对应的 study 对象，也就是 trial 的集合。</p>
<p>该对象提供了一系列接口，可用于运行新的 <code class="xref py py-class docutils literal notranslate"><span class="pre">Trial</span></code> 、获取 trial 历史记录和设置/获取用户定义属性。</p>
<p>注意，我们并不推荐直接使用该构造函数。要创建或者加载一个 study 的话，请参考 <a class="reference internal" href="#optuna.multi_objective.study.create_study" title="optuna.multi_objective.study.create_study"><code class="xref py py-func docutils literal notranslate"><span class="pre">create_study()</span></code></a> 和 <a class="reference internal" href="#optuna.multi_objective.study.load_study" title="optuna.multi_objective.study.load_study"><code class="xref py py-func docutils literal notranslate"><span class="pre">load_study()</span></code></a> 。</p>
<div class="admonition note">
<p class="admonition-title">注解</p>
<p>在 v1.4.0 中作为试验性特性引入，在未来版本中，该接口可能在没有预先告知的情况下被改变。参考 <a class="reference external" href="https://github.com/optuna/optuna/releases/tag/v1.4.0">https://github.com/optuna/optuna/releases/tag/v1.4.0</a>.</p>
</div>
<dl class="py method">
<dt id="optuna.multi_objective.study.MultiObjectiveStudy.directions">
<em class="property">property </em><code class="sig-name descname">directions</code><a class="headerlink" href="#optuna.multi_objective.study.MultiObjectiveStudy.directions" title="永久链接至目标">¶</a></dt>
<dd><p>返回优化方向列表。</p>
<dl class="field-list simple">
<dt class="field-odd">返回</dt>
<dd class="field-odd"><p>一个包含了每一个目标函数值的优化方向的列表。</p>
</dd>
</dl>
</dd></dl>

<dl class="py method">
<dt id="optuna.multi_objective.study.MultiObjectiveStudy.enqueue_trial">
<code class="sig-name descname">enqueue_trial</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">params</span><span class="p">:</span> <span class="n">Dict<span class="p">[</span><a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(在 Python v3.8)">str</a><span class="p">, </span>Any<span class="p">]</span></span></em><span class="sig-paren">)</span> &#x2192; <a class="reference external" href="https://docs.python.org/3/library/constants.html#None" title="(在 Python v3.8)">None</a><a class="reference internal" href="../../_modules/optuna/multi_objective/study.html#MultiObjectiveStudy.enqueue_trial"><span class="viewcode-link">[源代码]</span></a><a class="headerlink" href="#optuna.multi_objective.study.MultiObjectiveStudy.enqueue_trial" title="永久链接至目标">¶</a></dt>
<dd><p>将一个指定参数值的 trial 送入队列。</p>
<p>你可以固定在下一次目标函数求值中将用到的采样参数。</p>
<p>更多细节请参考 <a class="reference internal" href="../study.html#optuna.study.Study.enqueue_trial" title="optuna.study.Study.enqueue_trial"><code class="xref py py-func docutils literal notranslate"><span class="pre">optuna.study.Study.enqueue_trial()</span></code></a> 的文档。</p>
<dl class="field-list simple">
<dt class="field-odd">参数</dt>
<dd class="field-odd"><p><strong>params</strong> -- 传递给目标函数的参数值。</p>
</dd>
</dl>
</dd></dl>

<dl class="py method">
<dt id="optuna.multi_objective.study.MultiObjectiveStudy.get_pareto_front_trials">
<code class="sig-name descname">get_pareto_front_trials</code><span class="sig-paren">(</span><span class="sig-paren">)</span> &#x2192; List<span class="p">[</span><a class="reference internal" href="trial.html#optuna.multi_objective.trial.FrozenMultiObjectiveTrial" title="optuna.multi_objective.trial.FrozenMultiObjectiveTrial">optuna.multi_objective.trial.FrozenMultiObjectiveTrial</a><span class="p">]</span><a class="reference internal" href="../../_modules/optuna/multi_objective/study.html#MultiObjectiveStudy.get_pareto_front_trials"><span class="viewcode-link">[源代码]</span></a><a class="headerlink" href="#optuna.multi_objective.study.MultiObjectiveStudy.get_pareto_front_trials" title="永久链接至目标">¶</a></dt>
<dd><p>返回属于该 study 的帕累托前言面的 trial 。</p>
<p>如果没有其他 trial 能决定整个 trial 的话，该 trial 属于对应的帕累托前沿面。我们称一个 trial <code class="docutils literal notranslate"><span class="pre">t0</span></code> 决定了另一个 trial  <code class="docutils literal notranslate"><span class="pre">t1</span></code> if `` 如果 <code class="docutils literal notranslate"><span class="pre">all(v0</span> <span class="pre">&lt;=</span> <span class="pre">v1)</span> <span class="pre">for</span> <span class="pre">v0,</span> <span class="pre">v1</span> <span class="pre">in</span> <span class="pre">zip(t0.values,</span> <span class="pre">t1.values)</span></code> 而且 <code class="docutils literal notranslate"><span class="pre">any(v0</span> <span class="pre">&lt;</span> <span class="pre">v1)</span> <span class="pre">for</span> <span class="pre">v0,</span> <span class="pre">v1</span> <span class="pre">in</span> <span class="pre">zip(t0.values,</span> <span class="pre">t1.values)</span></code> 成立的话。</p>
<dl class="field-list simple">
<dt class="field-odd">返回</dt>
<dd class="field-odd"><p>一个由 <a class="reference internal" href="trial.html#optuna.multi_objective.trial.FrozenMultiObjectiveTrial" title="optuna.multi_objective.trial.FrozenMultiObjectiveTrial"><code class="xref py py-class docutils literal notranslate"><span class="pre">FrozenMultiObjectiveTrial</span></code></a> 对象构成的列表。</p>
</dd>
</dl>
</dd></dl>

<dl class="py method">
<dt id="optuna.multi_objective.study.MultiObjectiveStudy.get_trials">
<code class="sig-name descname">get_trials</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">deepcopy</span><span class="p">:</span> <span class="n"><a class="reference external" href="https://docs.python.org/3/library/functions.html#bool" title="(在 Python v3.8)">bool</a></span> <span class="o">=</span> <span class="default_value">True</span></em><span class="sig-paren">)</span> &#x2192; List<span class="p">[</span><a class="reference internal" href="trial.html#optuna.multi_objective.trial.FrozenMultiObjectiveTrial" title="optuna.multi_objective.trial.FrozenMultiObjectiveTrial">optuna.multi_objective.trial.FrozenMultiObjectiveTrial</a><span class="p">]</span><a class="reference internal" href="../../_modules/optuna/multi_objective/study.html#MultiObjectiveStudy.get_trials"><span class="viewcode-link">[源代码]</span></a><a class="headerlink" href="#optuna.multi_objective.study.MultiObjectiveStudy.get_trials" title="永久链接至目标">¶</a></dt>
<dd><p>返回该 study 中所有的 trial 。</p>
<p>返回的 trial 根据 trial number 排序。</p>
<p>对库用户来说，我们推荐使用更上手的 <a class="reference internal" href="#optuna.multi_objective.study.MultiObjectiveStudy.trials" title="optuna.multi_objective.study.MultiObjectiveStudy.trials"><code class="xref py py-attr docutils literal notranslate"><span class="pre">trials</span></code></a> 属性来获取 trial。</p>
<dl class="field-list simple">
<dt class="field-odd">参数</dt>
<dd class="field-odd"><p><strong>deepcopy</strong> -- 用于控制是否对 trial 应用 <code class="docutils literal notranslate"><span class="pre">copy.deepcopy()</span></code> 的选项。注意，如果你将该选项设置成 <a class="reference external" href="https://docs.python.org/3/library/constants.html#False" title="(在 Python v3.8)"><code class="xref py py-obj docutils literal notranslate"><span class="pre">False</span></code></a> ，  那就不要修改任何返回 trial 中的东西。否则 study 的内部状态可能会改变并且发生无法预知的行为。</p>
</dd>
<dt class="field-even">返回</dt>
<dd class="field-even"><p>一个由 <a class="reference internal" href="trial.html#optuna.multi_objective.trial.FrozenMultiObjectiveTrial" title="optuna.multi_objective.trial.FrozenMultiObjectiveTrial"><code class="xref py py-class docutils literal notranslate"><span class="pre">FrozenMultiObjectiveTrial</span></code></a> 对象构成的列表。</p>
</dd>
</dl>
</dd></dl>

<dl class="py method">
<dt id="optuna.multi_objective.study.MultiObjectiveStudy.n_objectives">
<em class="property">property </em><code class="sig-name descname">n_objectives</code><a class="headerlink" href="#optuna.multi_objective.study.MultiObjectiveStudy.n_objectives" title="永久链接至目标">¶</a></dt>
<dd><p>返回目标函数的数量。</p>
<dl class="field-list simple">
<dt class="field-odd">返回</dt>
<dd class="field-odd"><p>目标函数的数量。</p>
</dd>
</dl>
</dd></dl>

<dl class="py method">
<dt id="optuna.multi_objective.study.MultiObjectiveStudy.optimize">
<code class="sig-name descname">optimize</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">objective</span><span class="p">:</span> <span class="n">Callable<span class="p">[</span><span class="p">[</span>multi_objective.trial.MultiObjectiveTrial<span class="p">]</span><span class="p">, </span>Tuple<span class="p">[</span><a class="reference external" href="https://docs.python.org/3/library/functions.html#float" title="(在 Python v3.8)">float</a><span class="p">]</span><span class="p">]</span></span></em>, <em class="sig-param"><span class="n">timeout</span><span class="p">:</span> <span class="n">Optional<span class="p">[</span><a class="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(在 Python v3.8)">int</a><span class="p">]</span></span> <span class="o">=</span> <span class="default_value">None</span></em>, <em class="sig-param"><span class="n">n_trials</span><span class="p">:</span> <span class="n">Optional<span class="p">[</span><a class="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(在 Python v3.8)">int</a><span class="p">]</span></span> <span class="o">=</span> <span class="default_value">None</span></em>, <em class="sig-param"><span class="n">n_jobs</span><span class="p">:</span> <span class="n"><a class="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(在 Python v3.8)">int</a></span> <span class="o">=</span> <span class="default_value">1</span></em>, <em class="sig-param"><span class="n">catch</span><span class="p">:</span> <span class="n">Union<span class="p">[</span>Tuple<span class="p">[</span><span class="p">(</span><span class="p">)</span><span class="p">]</span><span class="p">, </span>Tuple<span class="p">[</span>Type<span class="p">[</span><a class="reference external" href="https://docs.python.org/3/library/exceptions.html#Exception" title="(在 Python v3.8)">Exception</a><span class="p">]</span><span class="p">]</span><span class="p">]</span></span> <span class="o">=</span> <span class="default_value">()</span></em>, <em class="sig-param"><span class="n">callbacks</span><span class="p">:</span> <span class="n">Optional[List[Callable[[multi_objective.study.MultiObjectiveStudy, multi_objective.trial.FrozenMultiObjectiveTrial], None]]]</span> <span class="o">=</span> <span class="default_value">None</span></em>, <em class="sig-param"><span class="n">gc_after_trial</span><span class="p">:</span> <span class="n"><a class="reference external" href="https://docs.python.org/3/library/functions.html#bool" title="(在 Python v3.8)">bool</a></span> <span class="o">=</span> <span class="default_value">True</span></em>, <em class="sig-param"><span class="n">show_progress_bar</span><span class="p">:</span> <span class="n"><a class="reference external" href="https://docs.python.org/3/library/functions.html#bool" title="(在 Python v3.8)">bool</a></span> <span class="o">=</span> <span class="default_value">False</span></em><span class="sig-paren">)</span> &#x2192; <a class="reference external" href="https://docs.python.org/3/library/constants.html#None" title="(在 Python v3.8)">None</a><a class="reference internal" href="../../_modules/optuna/multi_objective/study.html#MultiObjectiveStudy.optimize"><span class="viewcode-link">[源代码]</span></a><a class="headerlink" href="#optuna.multi_objective.study.MultiObjectiveStudy.optimize" title="永久链接至目标">¶</a></dt>
<dd><p>优化一个目标函数。</p>
<p>除了接受一个返回多个目标函数值的目标函数外，该方法和 <a class="reference internal" href="../study.html#optuna.study.Study.optimize" title="optuna.study.Study.optimize"><code class="xref py py-func docutils literal notranslate"><span class="pre">optuna.study.Study.optimize()</span></code></a> 是一样的。</p>
<p>更多细节请参考 <a class="reference internal" href="../study.html#optuna.study.Study.optimize" title="optuna.study.Study.optimize"><code class="xref py py-func docutils literal notranslate"><span class="pre">optuna.study.Study.optimize()</span></code></a> 的文档。</p>
</dd></dl>

<dl class="py method">
<dt id="optuna.multi_objective.study.MultiObjectiveStudy.sampler">
<em class="property">property </em><code class="sig-name descname">sampler</code><a class="headerlink" href="#optuna.multi_objective.study.MultiObjectiveStudy.sampler" title="永久链接至目标">¶</a></dt>
<dd><p>返回 sampler 。</p>
<dl class="field-list simple">
<dt class="field-odd">返回</dt>
<dd class="field-odd"><p>A <code class="xref py py-class docutils literal notranslate"><span class="pre">BaseMultiObjectiveSampler</span></code> object.</p>
</dd>
</dl>
</dd></dl>

<dl class="py method">
<dt id="optuna.multi_objective.study.MultiObjectiveStudy.set_user_attr">
<code class="sig-name descname">set_user_attr</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">key</span><span class="p">:</span> <span class="n"><a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(在 Python v3.8)">str</a></span></em>, <em class="sig-param"><span class="n">value</span><span class="p">:</span> <span class="n">Any</span></em><span class="sig-paren">)</span> &#x2192; <a class="reference external" href="https://docs.python.org/3/library/constants.html#None" title="(在 Python v3.8)">None</a><a class="reference internal" href="../../_modules/optuna/multi_objective/study.html#MultiObjectiveStudy.set_user_attr"><span class="viewcode-link">[源代码]</span></a><a class="headerlink" href="#optuna.multi_objective.study.MultiObjectiveStudy.set_user_attr" title="永久链接至目标">¶</a></dt>
<dd><p>设定一个该 study 的用户属性。</p>
<dl class="field-list simple">
<dt class="field-odd">参数</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>key</strong> -- 属性键</p></li>
<li><p><strong>value</strong> -- 属性值，该值应当是可 JSON 序列化的。</p></li>
</ul>
</dd>
</dl>
</dd></dl>

<dl class="py method">
<dt id="optuna.multi_objective.study.MultiObjectiveStudy.trials">
<em class="property">property </em><code class="sig-name descname">trials</code><a class="headerlink" href="#optuna.multi_objective.study.MultiObjectiveStudy.trials" title="永久链接至目标">¶</a></dt>
<dd><p>返回该 study 中所有的 trial 。</p>
<p>返回的 trial 根据 trial number 排序。</p>
<p>这是 <code class="docutils literal notranslate"><span class="pre">self.get_trials(deepcopy=True)</span></code> 的简写形式。</p>
<dl class="field-list simple">
<dt class="field-odd">返回</dt>
<dd class="field-odd"><p>一个由 <a class="reference internal" href="trial.html#optuna.multi_objective.trial.FrozenMultiObjectiveTrial" title="optuna.multi_objective.trial.FrozenMultiObjectiveTrial"><code class="xref py py-class docutils literal notranslate"><span class="pre">FrozenMultiObjectiveTrial</span></code></a> 对象构成的列表。</p>
</dd>
</dl>
</dd></dl>

<dl class="py method">
<dt id="optuna.multi_objective.study.MultiObjectiveStudy.user_attrs">
<em class="property">property </em><code class="sig-name descname">user_attrs</code><a class="headerlink" href="#optuna.multi_objective.study.MultiObjectiveStudy.user_attrs" title="永久链接至目标">¶</a></dt>
<dd><p>返回用户属性。</p>
<dl class="field-list simple">
<dt class="field-odd">返回</dt>
<dd class="field-odd"><p>包含所有用户属性的字典。</p>
</dd>
</dl>
</dd></dl>

</dd></dl>

<dl class="py function">
<dt id="optuna.multi_objective.study.create_study">
<code class="sig-prename descclassname">optuna.multi_objective.study.</code><code class="sig-name descname">create_study</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">directions</span><span class="p">:</span> <span class="n">List<span class="p">[</span><a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(在 Python v3.8)">str</a><span class="p">]</span></span></em>, <em class="sig-param"><span class="n">study_name</span><span class="p">:</span> <span class="n">Optional<span class="p">[</span><a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(在 Python v3.8)">str</a><span class="p">]</span></span> <span class="o">=</span> <span class="default_value">None</span></em>, <em class="sig-param"><span class="n">storage</span><span class="p">:</span> <span class="n">Union[None, str, optuna.storages._base.BaseStorage]</span> <span class="o">=</span> <span class="default_value">None</span></em>, <em class="sig-param"><span class="n">sampler</span><span class="p">:</span> <span class="n">Optional<span class="p">[</span>multi_objective.samplers.BaseMultiObjectiveSampler<span class="p">]</span></span> <span class="o">=</span> <span class="default_value">None</span></em>, <em class="sig-param"><span class="n">load_if_exists</span><span class="p">:</span> <span class="n"><a class="reference external" href="https://docs.python.org/3/library/functions.html#bool" title="(在 Python v3.8)">bool</a></span> <span class="o">=</span> <span class="default_value">False</span></em><span class="sig-paren">)</span> &#x2192; <a class="reference internal" href="#optuna.multi_objective.study.MultiObjectiveStudy" title="optuna.multi_objective.study.MultiObjectiveStudy">optuna.multi_objective.study.MultiObjectiveStudy</a><a class="reference internal" href="../../_modules/optuna/multi_objective/study.html#create_study"><span class="viewcode-link">[源代码]</span></a><a class="headerlink" href="#optuna.multi_objective.study.create_study" title="永久链接至目标">¶</a></dt>
<dd><p>创建一个新的 <a class="reference internal" href="#optuna.multi_objective.study.MultiObjectiveStudy" title="optuna.multi_objective.study.MultiObjectiveStudy"><code class="xref py py-class docutils literal notranslate"><span class="pre">MultiObjectiveStudy</span></code></a> 。</p>
<dl class="field-list simple">
<dt class="field-odd">参数</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>directions</strong> -- 每一个目标函数值的优化方向。 <code class="docutils literal notranslate"><span class="pre">minimize</span></code> 代表最小化， <code class="docutils literal notranslate"><span class="pre">maximize</span></code> 代表最大化。</p></li>
<li><p><strong>study_name</strong> -- Study 名。如果该值为 None，那么 Optuna 会</p></li>
<li><p><strong>storage</strong> -- 数据库 URL。如果该参数被设置成 None 的话，Optuna 将采用内存存储，而  <a class="reference internal" href="../study.html#optuna.study.Study" title="optuna.study.Study"><code class="xref py py-class docutils literal notranslate"><span class="pre">Study</span></code></a> 也就无法被持久化。  .. note::     在传入一个数据库 URL 后，Optuna 会在内部使用 <a class="reference internal" href="#sqlalchemy">SQLAlchemy</a> 来处理数据库。更多细节请参考  <a class="reference internal" href="#sqlalchemy-s-document">SQLAlchemy's document</a> 。如果想指定非默认的 <a class="reference internal" href="#sqlalchemy-engine">SQLAlchemy Engine</a> 的话，你可以不用URL，而是用你所需的选项来实例化一个 <a class="reference internal" href="../storages.html#optuna.storages.RDBStorage" title="optuna.storages.RDBStorage"><code class="xref py py-class docutils literal notranslate"><span class="pre">RDBStorage</span></code></a> 并将其传递给 <code class="docutils literal notranslate"><span class="pre">storage</span></code> 参数。  .. _SQLAlchemy: <a class="reference external" href="https://www.sqlalchemy.org/">https://www.sqlalchemy.org/</a>  .. _SQLAlchemy's document:      <a class="reference external" href="https://docs.sqlalchemy.org/en/latest/core/engines.html#database-urls">https://docs.sqlalchemy.org/en/latest/core/engines.html#database-urls</a>  .. _SQLAlchemy Engine: <a class="reference external" href="https://docs.sqlalchemy.org/en/latest/core/engines.html">https://docs.sqlalchemy.org/en/latest/core/engines.html</a></p></li>
<li><p><strong>sampler</strong> -- 一个实现了幕后 suggestion value 算法的 sampler 对象。如果设置成 <a class="reference external" href="https://docs.python.org/3/library/constants.html#None" title="(在 Python v3.8)"><code class="xref py py-obj docutils literal notranslate"><span class="pre">None</span></code></a> 的话， Optuna 将使用 <a class="reference internal" href="samplers.html#optuna.multi_objective.samplers.NSGAIIMultiObjectiveSampler" title="optuna.multi_objective.samplers.NSGAIIMultiObjectiveSampler"><code class="xref py py-class docutils literal notranslate"><span class="pre">NSGAIIMultiObjectiveSampler</span></code></a> 作为默认值。参见 <a class="reference internal" href="samplers.html#module-optuna.multi_objective.samplers" title="optuna.multi_objective.samplers"><code class="xref py py-class docutils literal notranslate"><span class="pre">samplers</span></code></a> 。</p></li>
<li><p><strong>load_if_exists</strong> -- 用于控制处理 study 名冲突情况下 Optuna 行为的选项。如果 <code class="docutils literal notranslate"><span class="pre">load_if_exists</span></code> 是 <a class="reference external" href="https://docs.python.org/3/library/constants.html#False" title="(在 Python v3.8)"><code class="xref py py-obj docutils literal notranslate"><span class="pre">False</span></code></a> 且一个名为  <code class="docutils literal notranslate"><span class="pre">study_name</span></code>  的 study 已经在 <code class="docutils literal notranslate"><span class="pre">storage</span></code> 中，Optuna 将抛出一个 <a class="reference internal" href="../exceptions.html#optuna.exceptions.DuplicatedStudyError" title="optuna.exceptions.DuplicatedStudyError"><code class="xref py py-class docutils literal notranslate"><span class="pre">DuplicatedStudyError</span></code></a> 错误。否则，Optuna 将跳过创建 study 的过程，直接返回现存的那个 study。</p></li>
</ul>
</dd>
<dt class="field-even">返回</dt>
<dd class="field-even"><p><a class="reference internal" href="#optuna.multi_objective.study.MultiObjectiveStudy" title="optuna.multi_objective.study.MultiObjectiveStudy"><code class="xref py py-class docutils literal notranslate"><span class="pre">MultiObjectiveStudy</span></code></a> 对象。</p>
</dd>
</dl>
<div class="admonition note">
<p class="admonition-title">注解</p>
<p>在 v1.4.0 中作为试验性特性引入，在未来版本中，该接口可能在没有预先告知的情况下被改变。参考 <a class="reference external" href="https://github.com/optuna/optuna/releases/tag/v1.4.0">https://github.com/optuna/optuna/releases/tag/v1.4.0</a>.</p>
</div>
</dd></dl>

<dl class="py function">
<dt id="optuna.multi_objective.study.load_study">
<code class="sig-prename descclassname">optuna.multi_objective.study.</code><code class="sig-name descname">load_study</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">study_name</span><span class="p">:</span> <span class="n"><a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(在 Python v3.8)">str</a></span></em>, <em class="sig-param"><span class="n">storage</span><span class="p">:</span> <span class="n">Union<span class="p">[</span><a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(在 Python v3.8)">str</a><span class="p">, </span>optuna.storages._base.BaseStorage<span class="p">]</span></span></em>, <em class="sig-param"><span class="n">sampler</span><span class="p">:</span> <span class="n">Optional<span class="p">[</span>multi_objective.samplers.BaseMultiObjectiveSampler<span class="p">]</span></span> <span class="o">=</span> <span class="default_value">None</span></em><span class="sig-paren">)</span> &#x2192; <a class="reference internal" href="#optuna.multi_objective.study.MultiObjectiveStudy" title="optuna.multi_objective.study.MultiObjectiveStudy">optuna.multi_objective.study.MultiObjectiveStudy</a><a class="reference internal" href="../../_modules/optuna/multi_objective/study.html#load_study"><span class="viewcode-link">[源代码]</span></a><a class="headerlink" href="#optuna.multi_objective.study.load_study" title="永久链接至目标">¶</a></dt>
<dd><p>加载指定名称的 <a class="reference internal" href="#optuna.multi_objective.study.MultiObjectiveStudy" title="optuna.multi_objective.study.MultiObjectiveStudy"><code class="xref py py-class docutils literal notranslate"><span class="pre">MultiObjectiveStudy</span></code></a> 。</p>
<dl class="field-list simple">
<dt class="field-odd">参数</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>study_name</strong> -- Study 名。每个 study 都有一个唯一名称作为标识符。</p></li>
<li><p><strong>storage</strong> -- 像 <code class="docutils literal notranslate"><span class="pre">sqlite:///example.db</span></code> 这样的数据库 URL 。 更多细节请参考 <a class="reference internal" href="#optuna.multi_objective.study.create_study" title="optuna.multi_objective.study.create_study"><code class="xref py py-func docutils literal notranslate"><span class="pre">create_study()</span></code></a> 。</p></li>
<li><p><strong>sampler</strong> -- A sampler object that implements background algorithm for value suggestion.
If <a class="reference external" href="https://docs.python.org/3/library/constants.html#None" title="(在 Python v3.8)"><code class="xref py py-obj docutils literal notranslate"><span class="pre">None</span></code></a> is specified,
<a class="reference internal" href="samplers.html#optuna.multi_objective.samplers.RandomMultiObjectiveSampler" title="optuna.multi_objective.samplers.RandomMultiObjectiveSampler"><code class="xref py py-class docutils literal notranslate"><span class="pre">RandomMultiObjectiveSampler</span></code></a> is used
as the default. See also <a class="reference internal" href="samplers.html#module-optuna.multi_objective.samplers" title="optuna.multi_objective.samplers"><code class="xref py py-class docutils literal notranslate"><span class="pre">samplers</span></code></a>.</p></li>
</ul>
</dd>
<dt class="field-even">返回</dt>
<dd class="field-even"><p><a class="reference internal" href="#optuna.multi_objective.study.MultiObjectiveStudy" title="optuna.multi_objective.study.MultiObjectiveStudy"><code class="xref py py-class docutils literal notranslate"><span class="pre">MultiObjectiveStudy</span></code></a> 对象。</p>
</dd>
</dl>
<div class="admonition note">
<p class="admonition-title">注解</p>
<p>在 v1.4.0 中作为试验性特性引入，在未来版本中，该接口可能在没有预先告知的情况下被改变。参考 <a class="reference external" href="https://github.com/optuna/optuna/releases/tag/v1.4.0">https://github.com/optuna/optuna/releases/tag/v1.4.0</a>.</p>
</div>
</dd></dl>

</div>


           </div>
           
          </div>
          <footer>
  
    <div class="rst-footer-buttons" role="navigation" aria-label="footer navigation">
      
        <a href="trial.html" class="btn btn-neutral float-right" title="Trial" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right"></span></a>
      
      
        <a href="samplers.html" class="btn btn-neutral float-left" title="Samplers" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left"></span> Previous</a>
      
    </div>
  

  <hr/>

  <div role="contentinfo">
    <p>
        &copy; Copyright 2018, Optuna Contributors.

    </p>
  </div>
  Built with <a href="http://sphinx-doc.org/">Sphinx</a> using a <a href="https://github.com/rtfd/sphinx_rtd_theme">theme</a> provided by <a href="https://readthedocs.org">Read the Docs</a>.
    <a href="../../privacy.html">Privacy Policy</a>.
     


</footer>

        </div>
      </div>

    </section>

  </div>
  


  <script type="text/javascript">
      jQuery(function () {
          SphinxRtdTheme.Navigation.enable(true);
      });
  </script>

  
  
    
    <!-- Theme Analytics -->
    <script>
    (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
      (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
      m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
    })(window,document,'script','https://www.google-analytics.com/analytics.js','ga');

    ga('create', 'UA-55135190-8', 'auto');
    ga('send', 'pageview');
    </script>

    
   

</body>
</html>